In computer programming, static variables (e.g., global variables) have a lifetime that extends to the life of a program. However, when the program stops executing, these variables are deallocated. Similarly, automatic variables (e.g., local variables) have a lifetime that extends to the duration of the function in which they are executed, but once that function completes execution then they are deallocated, and therefore they do not survive multiple function calls. Moreover, the size of static and automatic variables must be known when a program is compiled.
To facilitate variables whose size is unknown until runtime, and/or to facilitate variables whose life extends outside of the execution of a program or function, dynamic memory allocation is used to create dynamic variables. In the prior art, dynamic allocation has used a “heap” portion of system memory. Use of the heap has involved a complex system of pointers which requires a significant amount of computing resources to process. For example, in the C programming language “malloc” is a commonly used dynamic memory allocation tool. When invoked, malloc looks for free space in the heap, and once free space is found it reserves that free space and returns a pointer to the reserved portion of the heap. The process of looking for free space in the heap (and correspondingly freeing up used space in the heap through deallocation when it is no longer needed) has required a considerable amount of computing resources. An alternate dynamic memory allocation scheme known as the “buddy system” provides some improvements, but is still relatively inefficient.